<!--
 * @Description: 天气预报设置
 * @version: 电子名片2.0
 * @Author: 付小清
 * @Date: 2020-11-23 10:23:52
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2021-04-13 19:07:37
-->

<template>
  <div class="form-box">
    <el-form ref="refForm" :size="size" label-width="150px" :model="formData" :validate-on-rule-change="false">
      <el-form-item prop="url" :rules="formVerify.url" label="天气预报平台网址：">
        <el-input v-model="formData.url" :disabled="true" />
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
// 接口
// import { userSet } from '@/api/basics'
export default {
  data() {
    return {
      formData: {
        url: 'https://free-api.heweather.net/s6/weather/now'
      },
      formVerify: {
        url: [
          { required: true, message: '请输入天气预报平台网址', trigger: 'blur' }
        ]
      }
    }
  },
  computed: {
    size() {
      return this.$store.getters.size
    }
  },
  mounted() {

  },
  methods: {
    submitForm() {
      try {
        this.$refs.refForm.validate((valid) => {
          if (valid) {
            // userSet(this.formData).then(res => {
            //   if (res.code === 0) {
            //     this.$message.success(res.data)
            //   }
            // })
          } else {
            console.log('error submit!!')
          }
        })
      } catch (e) {
        console.log(e)
      }
    }

  }
}
</script>

<style lang="scss" scoped>
</style>
